<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="惠信钱包，金融">
<meta name="description" content="描述描述描述" />
<%@include file="/WEB-INF/base/commRoot.jsp"%>
<script type="text/javascript" src="/js/jquery.js"></script> 
<script type="text/javascript" src="/js/jquery-1.8.3.min.js"></script> 
<script type="text/javascript" src="/js/rsa/RSA.js"></script> 
<script type="text/javascript" src="/js/rsa/BigInt.js"></script> 
<script type="text/javascript" src="/js/rsa/Barrett.js"></script> 
<script type="text/javascript" src="/js/rsa/RsaDataUtil.js"></script>
<script type="text/javascript" src="/js/view/static/static.js"></script>
<script type="text/javascript" src="/js/view/user/login.js"></script>
<script type="text/javascript" src="/js/placeholder.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script type="text/javascript" src="/js/win_layer/win_layer.js"></script>
<title>完善信息</title>
<script type="text/javascript">
$(function() {
	//获取登录错误信息
	var errormsg='${errorMsg}';
	if(errormsg!=""){
		alert(errormsg);
	}
});

function toRegisterSuccess(){
	if(true 
		<s:if test="userRegister == null || userRegister.pwd ==null || userRegister.pwd =='' ">&& testPassword() </s:if>
	){
	    $('#regist_next_btn').attr("disabled",true); 
	    
	    $("#rsaPwd").val(rsaData($("#pwd").val()));
		var ii = layer.load('提交中...');
		$.ajax({
			url: ctx_root+"/userAction_toFirstLoginSucceed.action",
			data:$("#registerSuccess").serializeArray(),
			type:"POST",
			dataType:'json',
			success:function(data){
				var json = eval(data);									
				$.each(json, function (index) { 
					  var rs = json[index].rs;
					  var errorMsg = json[index].errorMsg;				  
					  if (rs == "false") {
		   				layer.close(ii);
		   				layer.alert(errorMsg, 8);
		   				return;
		   			  } else {
		   				layer.close(ii);
		   				/*layer.alert("完善信息成功！",9,function(){	//对话框中图像:10对勾 8失败苦脸 9成功笑脸  
		   				  location.href=ctx_root+"/userLoginSuccessAction_toMyPurse.action";//跳转到我的账户
		   				});*/
		   				location.href=ctx_root+"/userLoginSuccessAction_toMyPurse.action";//跳转到我的账户
		   			   }

				});
				
				
					
			},
			error:function(e){
				$("#errorMsg").show();
				$("#errorMsg").text("系统繁忙，请稍后再试");
				return false;
			} 
		});
		
	}
}

//隐藏登录密码提示
function hidePwdLable(){
	var pwd=$("#pwd").val();
	if(pwd==""){
		$("#pwdMsg").hide();
		alert($("#pwd").type);
	}
}

//隐藏真实姓名提示
function hideRealNameLable(){
	var realName=$("#realName").val();
	if(realName==""){
		$("#realNameMsg").hide();
	}
}

//隐藏身份证提示
function hideIdcardLable(){
	var idcard=$("#idcard").val();
	if(idcard==""){
		$("#idcardMsg").hide();
	}
}

//隐藏支付密码提示
function hidePayPwdLable(){
	var payPwd=$("#payPwd").val();
	if(payPwd==""){
		$("#payPwdMsg").hide();
	}
}
</script>
</head>
<body>
<input id="module" type="hidden" value="<s:property value='#application.module'/>">
<input id="empoent" type="hidden" value="<s:property value='#application.empoent'/>">
<!--main-->
<!--header-->
<%@include file="/head.jsp"%>
<!--/header-->
<div class="main_bg">        	
	<div class="regist firstRegist">
    	<h3 class="login_first_tit">完善信息</h3>
    	<form action="${root}/userAction_toFirstLoginSucceed.action" id="registerSuccess"  name="registerSuccess" method="post">   
        <ul>
        	
        	<s:if test="userRegister == null || userRegister.pwd ==null || userRegister.pwd =='' ">
        	<li class="clearfix">
            	<label>登录密码：</label>
                <div class="position"><input type="password" id="pwd"  autocomplete="off" class="input" placeholder="请输入您的登录密码" onpaste="return false" onblur="testPassword();" /><span class="in_dea_text"></span>
                <input id="rsaPwd" name="rsaPwd" type="hidden"/>
                </div>
                <p class="suc_tips" id="pwdRight" style="display:none;"></p>
                <p class="err_tips" id="pwdMsg" style="display:none;"></p>
            </li>
            </s:if>
        	
        	<li class="clearfix">
            <a id="regist_next_btn" href="javascript:void(0);" onclick="javascript:toRegisterSuccess();" class="mar_li btn l">下一步</a>
            <p style="display:none" id="errorMsg" class="err_tips"></p>
            </li>
            
        </ul>
        <s:token />
         </form>
    </div>

            


</div>
<!--/main-->
<!--footer-->
<%@include file="/footer.jsp"%>
</body>

<script type="text/javascript">
$(function(){
	  $("#registerSuccess").keypress(function(e) {
	  if (e.which == 13) {
	    return false;
	  }
	});
});
</script>
</html>
